/*********************************************************************\
*
*                  (c) lkc
*                  All Rights Reserved. lkc Confidential
*
\*********************************************************************/
/*********************************************************************\
*   Title                      :
*
*   Module Description         :
*
*   Author                     : lkc
*
*   Created                    : 2018-7-24
*
\*********************************************************************/

#include <memory.h>
#include "CommBaseQt.h"

#include <QThread>

CommBaseQt::CommBaseQt(QObject* parent)
    :QObject(parent)
{
}

int CommBaseQt::ReadAndParse()
{
    while(true)
    {
        int BUFFER_SIZE = 1024;
        unsigned char buf[BUFFER_SIZE];
        memset(buf,0,BUFFER_SIZE);
        int ret = Read(buf,BUFFER_SIZE);
        if(ret<=0)
        {
            break;
        }
        if(ExtractFun != nullptr)
        {
            ExtractFun(buf,ret);
        }
    }
    return 1;
}

/********************************************************************\
 *
 * REVISION RECORDS
 *
\*********************************************************************/
/*********************************************************************/
/*
 *
 *
 *
\*********************************************************************/
/*------------------------------The End------------------------------*/

